package com.cxb.serviceorder.remote;

import com.cxb.internalcommon.dto.Car;
import com.cxb.internalcommon.dto.ResponseResult;
import com.cxb.internalcommon.responese.OrderDriverResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("service-driver-user")
public interface ServiceDriverUserClient {

    @GetMapping("/city-driver/is-available-driver")
    public ResponseResult<Boolean> isAvailableDriver(@RequestParam String cityCode);

    /**
     * 根据车辆id查询订单所需要的司机信息
     * @param carId
     * @return
     */
    @GetMapping("/get-available-driver/{carId}")
    public ResponseResult<OrderDriverResponse> getAvailableDriver(@PathVariable("carId") Long carId);

    /**
     * 查询车辆id
     * @param carId
     * @return
     */
    @GetMapping("/car")
    public ResponseResult<Car> getCarById(@RequestParam Long carId);
}
